package com.zengqingfa.designpattern.behavior.observer.spring;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 *
 * @fileName: ConcreteObserver2
 * @author: zengqf3
 * @date: 2021-4-23 15:10
 * @description:
 *  ApplicationListener：事件监听器接口，事件的业务逻辑封装在监听器里面
 */
@Component
public class ConcreteObserver2 implements ApplicationListener<Notice> {


    @Override
    public void onApplicationEvent(Notice event) {
        System.out.println("观察者ConcreteObserver2收到消息:" + event);
    }
}
